module.exports = class extends think.Controller {
  auth = this.service('auth')
  token = this.service('token')
  async __before() {
    
    const token = this.header('token')
    if(!token) {
      think.logger.info(this.ctx.query)
      this.fail(401, '无权限访问')
      return false
    }
    const res = this.token.verify(token)
    this.ctx.state.userInfo = res
  }
};
